 <?php

if(isset($_POST['ID']))
{

 try{  

	 $connect = new PDO('mysql:host=localhost;dbname=basketbal','cas','cas');
	 $connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	 $query = "UPDATE video_other 
	 SET embed_code = :embed_code, title = :title, comment = :comment
	 WHERE ID = :ID";
	 $statement = $connect->prepare($query);
	 $sql_status = $statement->execute(
	  array(
	   ':embed_code'  => $_POST['embed_code'],
	   ':title'  => $_POST["title"],
	   ':comment'  => $_POST["comment"],
	   ':ID' => $_POST["ID"]
	  )
	 );
	 $output = '';
	 if ($sql_status) {
	 	$time = date('Y-m-d H:m:s');
	 	  $output = "
	  <div class=\"alert alert-success\">
	   Your video entry has been updated at $time
	  </div>
	  ";
	 } else {
	 	$output = "Something Wrong";
	 }

} catch (PDOException $e) {
    
    $output = $e->getMessage();
}

 echo $output;

}

?>